package com.biz.aoao.mysql.mysqlbinlogsync.util;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class HttpUtil {
    public static void sync(){
        try{
            HashMap<String, Object> paramMap = new HashMap<>();
            String request = JSON.toJSONString(paramMap);
            String result = HttpRequest.get(PathUtil.syncUrl)
                    .body(request)//表单内容
                    .timeout(20000)//超时，毫秒
                    .execute().body();
            System.out.println(result);
        }catch (Exception e){
            System.out.println("同步请求异常");
            System.out.println(e.getMessage());
        }
    }
}
